package com.sz.ac.services.ac;

import com.sz.ac.entity.AcUser;
import com.sz.ac.interfs.IAcUserService;
import com.sz.ac.model.constant.DefMsgException;
import com.sz.ac.services.mapper.ac.AcUserMapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 后台登录用户表 服务实现类
 * </p>
 *
 * @author ruichar
 * @since 2018-03-24
 */
@Service
public class AcUserServiceImpl extends ServiceImpl<AcUserMapper, AcUser> implements IAcUserService {
	private final Logger logger = LoggerFactory.getLogger(AcUserServiceImpl.class);
	@Resource 
	private AcUserMapper userMapper;
	public boolean login(String name, String pwd) 
	{
		boolean isOk = false;
		Map<String, Object> column = new HashMap<String, Object>();
		column.put("user_name", name);
		column.put("pwd", pwd);
		List<AcUser> ret = userMapper.selectByMap(column);
		if(ret == null || ret.isEmpty())
		{
			logger.error("=====userName={},pwd={}==is not in db==",name,pwd);
		}else{
			isOk = true;
		}
		return isOk;
		
		
		
	}
	
}
